<app:page xmlns:h="http://java.sun.com/jsf/html"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:app="http://java.sun.com/jsf/composite/app"
          xmlns:ds="http://deltaset.org/deltaset-faces"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:c="http://java.sun.com/jsp/jstl/core"
          pageTitle="#{transportMsg['view.title']}">    

    <ds:titlebar title="#{transportMsg['view.title']}">
        <h:button outcome="/secured/transport/form" 
                  value="#{deltasetMessages['deltaset.crud.add']}"
                  styleClass="ds-button"/>
        <h:button outcome="/secured/transport/list" 
                  value="#{deltasetMessages['deltaset.crud.list']}"
                  styleClass="ds-button"/>
    </ds:titlebar>
    <c:set target="#{viewScope}" property="transportModel" value="#{transportBean.loadModel(param.transportId)}"/>
    
    <h:form>
        <ds:fieldset>
            <h:messages styleClass="ui-state-highlight ui-corner-all"/>

            <ds:inputText label="#{transportMsg['transportName']}"
                          value="#{viewScope.transportModel.transportName}"
                          requiredMessage="#{deltasetMessages['deltaset.crud.required']}"
                          required="true"/> 
            <ds:inputText label="#{transportMsg['transportDescription']}"
                          value="#{viewScope.transportModel.transportDescription}"
                          requiredMessage="#{deltasetMessages['deltaset.crud.required']}"
                          required="true"/>                           
            <h:outputLabel for="type" value="#{transportMsg['type']}" styleClass="ds-label"/>
            <h:selectOneListbox id="type" value="#{viewScope.transportModel.type}"  styleClass="ui-widget-content ui-corner-all ds-field" size="1">
                <f:selectItems  value="#{transportBean.typeValues}" var="op"
                                itemValue="#{op}" itemLabel="#{op.label}"/>
            </h:selectOneListbox>                                                 
        </ds:fieldset>       
        
        <div class="ds-margin-top">
            <h:commandButton action="#{transportBean.save(viewScope.transportModel)}"
                             value="#{deltasetMessages['deltaset.crud.save']}"
                             styleClass="ds-button">               
            </h:commandButton>
            <h:commandButton value="#{deltasetMessages['deltaset.crud.delete']}"
                             action="#{transportBean.delete(viewScope.transportModel)}"
                             onclick="return deltaset.confirm(this)"
                             disabled="#{transportBean.isNew(viewScope.transportModel)}"
                             styleClass="ds-button">               
            </h:commandButton>
        </div>
    </h:form>
</app:page>